#ifndef QRESOURCEFILEMODEL_H
#define QRESOURCEFILEMODEL_H

#include <QAbstractListModel>
#include <QList>
#include <QIcon>

class AbstractCore;

struct tagResourceInfo
{
    QString     m_name;
    bool        m_bSelect;
    QIcon       m_icon;
};

class QResourceFileModel: public QAbstractListModel
{
    Q_OBJECT
public:
    QResourceFileModel(AbstractCore *core,QObject *parent = 0);

    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
    virtual bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
    virtual Qt::ItemFlags flags (const QModelIndex & index ) const;


    void    addFile(QString name);
    void    removeFile(QString name);
    void    clear();
    QString select();

    int  findResource(QString name);
protected:
    QList<tagResourceInfo>       m_resourceInfos;
    AbstractCore                 *m_core;
};

#endif // QRESOURCEFILEMODEL_H
